package org.liuqm;

import org.liuqm.mapper.BuyerMapper;
import org.liuqm.mapper.BuyerMapperImpl;
import org.liuqm.workhome.CgLibProxyFactory;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.HashMap;
import java.util.Map;

public class ReflectTest {

    public static void main(String[] args) throws NoSuchFieldException {

        BuyerVo buyerVo = CgLibProxyFactory.getProxy(new BuyerVo());
        buyerVo.setAge(10);


//        Map<String,String> map = new HashMap<String,String>();
//
//        map.put("name","张三");
//        map.put("sex","男");
//        BuyerMapper buyerMapper = new BuyerMapperImpl();
//
//        buyerMapper.getCount(map.get("name"),map.get("sex"));

//
//        BuyerMapper buyerMapper = new BuyerMapperImpl();
//        buyerMapper.getCount(name, sex);

//        BuyerMapper buyerMapper;
//        //获取BuyerMapper的所有方法
//        Class clazz = BuyerMapper.class;
//
//        Method[] methods = clazz.getMethods();
//
//        //获取所有方法的入参名称
//        for (int i = 0; i < methods.length; i++) {
//            Method method = methods[i];
//
//            Parameter[] parameters = method.getParameters();
//            for (int j = 0; j < parameters.length; j++) {
//                Parameter parameter = parameters[j];
//                CustoParam annotation = parameter.getAnnotation(CustoParam.class);
//                System.out.println(annotation.value());
//            }
//
//
//        }


    }
}
